package com.zzh;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties;

/**
 * @Author: zhengzihong
 * @Desciotion:
 * @Date: Created in 17:47 2019/2/13
 * @Modified By:
 */
@EnableEurekaClient
@SpringBootApplication
@EnableZuulProxy
public class ApplicationZuulGateway {

    public static void main(String[] args) {
        SpringApplication.run(ApplicationZuulGateway.class,args);
    }

    /**
     * zuul配置能够使用config实现实时更新
     * @return
     */
    @RefreshScope
    @ConfigurationProperties("zuul")
    public ZuulProperties zuulProperties(){
        return new ZuulProperties();
    }

}
